package com.tcoiss.datafactory.service;

import com.tcoiss.datafactory.domain.BusTable;
import com.tcoiss.datafactory.domain.BusTableColumn;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface IDynamicSqlService {

    boolean createTable(String tabName, String dbName, List<BusTableColumn> columns);

    boolean createView(String tabName, String dbName, List<String> tab_fields, String viewsql);

    int batchInsert(BusTable busTable, String[] tab_fields, List<Object[]> list);

    int batchUpdateOrInsert(BusTable busTable, String[] tab_fields, List<Object[]> list);

    boolean deleteByField(String tabName, String dbName, String field, String fieldValue);

    List<Map<String,Object>> query(String tabName, String dbName, String[] whereFields, String[] fieldData, String[] tab_fields);

    List<Map<String,Object>> query(String tabName, String dbName, String whereFields, String[] tab_fields);

    Date queryNewestTime(String tabName, String dbName, String time_field);

    boolean delete(String tabName, String dbName);

    boolean exitTable(String tabName, String dbName);

    boolean dropTable(String tabName, String dbName, String tableType);

    int callProcedureByParam(String sql, String dbName, Object[] objects);

    int callProcedure(String sql, String dbName, Object[] objects);

    Integer getCount(String tabName, String dbName);

    public Long getCountByDateTime(BusTable table,String dbName);

}
